from django.shortcuts import render, HttpResponse


# Create your views here.
def upload(request):
    if request.method == 'POST':
        data = request.FILES.get('f1')
        with open(data.name, 'wb') as f:
            for i in data.chunks():
                f.write(i)
        return HttpResponse('ok')
    return render(request, 'index.html')
